from flask import Flask, session

app = Flask(__name__)
app.secret_key = '123123'

@app.route('/x1', methods=['GET', 'POST'])
def index():
    session['k1'] = 123
    return 'index'

@app.route('/x2')
def order():
    print(session['k1'])
    return str(session['k1'])


if __name__ == '__main__':
    # 1. 当由请求过来的时候，调用这个 __call__() 函数
    # app.__call__()
    app.run()